import { AES, enc, mode, pad } from "crypto-js";

const processsAes = {
  key: "hxthswebapp01234",
  iv: "0123456789abcdef",
};

// 加密方式
export function Encrypt(content) {
  const str = content.toString();
  const key = enc.Utf8.parse(processsAes.key);
  const iv = enc.Utf8.parse(processsAes.iv);
  let encrypted = AES.encrypt(str, key, {
    iv: iv,
    mode: mode.CBC,
    padding: pad.Pkcs7,
  }); // 转换为字符串
  encrypted = encrypted.toString();
  return encrypted;
}

